/**
 * get参数处理
 */

const url = require('url');

// let str = 'https://www.baidu.com/s?ie=utf-8&&wd=java';

// let ret = url.parse(str,true);

// console.log(ret.query.ie);


// let obj = {
//     protocol: 'https:',
//     slashes: true,
//     auth: null,
//     host: 'www.baidu.com',
//     port: null,
//     hostname: 'www.baidu.com',
//     hash: null,
//     search: '?ie=utf-8&&wd=java',
//     query: 'ie=utf-8&&wd=java',
//     pathname: '/s',
//     path: '/s?ie=utf-8&&wd=java',
//     href: 'https://www.baidu.com/s?ie=utf-8&&wd=java'
// };

// let ret1 = url.format(obj);
// console.log(ret)